/*
 * This file is part of the Berlioz library.
 *
 * For licensing information please see the file license.txt included in the release.
 * A copy of this licence can also be found at
 *   http://www.opensource.org/licenses/artistic-license-2.0.php
 */
package org.weborganic.berlioz.servlet;

/**
 * Holds the results of a transformation process.
 *
 * <p>This class holds information about a process such as its content, processing time (in ms),
 * status and exception.
 *
 * @author Christophe Lauret
 *
 * @version Berlioz 0.9.14 - 22 January 2013
 * @since Berlioz 0.6
 */
public final class XMLContent implements BerliozOutput {

  /**
   * The content generated by the process.
   */
  private final CharSequence _content;

  /**
   * Creates some new XML content.
   *
   * @param content The content.
   */
  public XMLContent(CharSequence content) {
    this._content = content;
  }

  /**
   * @return The actual XML content.
   */
  @Override
  public CharSequence content() {
    return this._content;
  }

  /**
   * @return Always <code>application/xml</code>.
   */
  @Override
  public String getMediaType() {
    return "application/xml";
  }

  /**
   * @return Always <code>utf-8</code>.
   */
  @Override
  public String getEncoding() {
    return "utf-8";
  }

}
